<%-- 
    Document   : risultatiRicerca
    Created on : Feb 14, 2012, 11:58:49 AM
    Author     : Giuseppe
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="JS/style.js" type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" href="style.css">
        <script src="JS/controlloRegistrazione.js"></script>
        <title>Ricerca <%=request.getParameter("tipo")%></title>
    </head>
    <body>
        <%@include file="header.jsp" %>
        <div id="content">
            <fieldset>
                <legend>Risultati ricerca</legend>
                <%
                    List<String[]> ris = (ArrayList<String[]>) session.getAttribute("risultato");
                    session.setAttribute("risultato", null);
                %>
                <% if (request.getParameter("tipo").equals("locale")) {%>
                <table border="0" class="ricerca">
                    <tr>
                        <th>
                            
                        </th>
                        <th>
                            Nome locale
                        </th>
                        <th>
                            Descrizione
                        </th>
                        <th>
                            Indirizzo
                        </th>
                    </tr>
                    <%
                        for (int i = 0; i < ris.size(); i++) {
                            String[] temp = ris.get(i);
                    %>
                    <tr >
                        <td>    
                            <a href="/EsameSSCSWeb-war/Servlet?action=locale&nome=<%=temp[0]%>"><img src="<%=temp[8]%>" width="100"/></a>
                        </td>
                        <td>
                            <%=temp[0]%>
                        </td>
                        <td>
                            <%=temp[1]%>
                        </td>
                        <td>    
                            <%=temp[3]%>
                        </td>
                    </tr>
                    <% }%>
                </table>
                <% } else {%>
                <table border="0" class="ricerca">
                        <th>
                            
                        </th>
                        <th>
                            Nome evento
                        </th>
                        <th>
                            Data evento
                        </th>
                        <th>
                            Locale organizzatore
                        </th>
                        <th>
                            Descrizione
                        </th>
                    <%
                        for (int i = 0; i < ris.size(); i++) {
                            String[] temp = ris.get(i);
                    %>
                    <tr>
                        <td>
                            <a href="/EsameSSCSWeb-war/Servlet?action=evento&nome=<%=temp[0]%>"><img src="<%=temp[3]%>" width="100"/></a>
                        </td>
                        <td>
                            <%=temp[0]%>
                        </td>
                        <td>
                            <%=temp[1]%>
                        </td>
                        <td>
                            <a href="/EsameSSCSWeb-war/Servlet?action=locale&nome=<%=temp[5]%>"><%=temp[5]%></a>
                        </td>
                        <td>
                            <%=temp[2]%>
                        </td>
                    </tr>
                    <% }%>
                </table>
                <%}%>
            </fieldset>
        </div>
        <script type="text/javascript">
            window.onload = function()
            {
                sottobarra=document.getElementById("subbar1");  
                cerca=document.getElementById("cerca");
                sottobarra2=document.getElementById("subbar2");  
                sottobarra3=document.getElementById("subbar3");  
                login=document.getElementById("login");
                cerca.style.display="none";
                sottobarra.style.display="none";
                login.style.display="none";
                if(sottobarra2!=null)
                    sottobarra2.style.display="none";
                else
                    sottobarra3.style.display="none";
            }
         </script>
    </body>
</html>
